/**
 * @file
 * @author dousha
 * @date 2020
 */

#ifndef CLOCK_H
#define CLOCK_H

#include <stdint.h>

#include "../config.h"

#ifdef STM32F407
const static uint32_t SYSTEM_FREQUENCY = 168000000;
#endif

#ifdef STM32F412
const static uint32_t SYSTEM_FREQUENCY = 96000000;
#endif

extern void clock_init();

extern uint32_t clock_get();

extern uint32_t clock_decade_get();

extern int32_t clock_ticks_from_now(uint32_t, uint32_t);

extern uint32_t clock_decade_after_ticks(uint32_t);

extern uint32_t clock_time_after_ticks(uint32_t);

extern void clock_tick();

#endif
